home *** CD-ROM | disk | FTP | other *** search
- <title>Library</title>
-
- <script language="EasyScript">
-
- directory = getRegistryValue ("Library", "directory", "images");
- sub_directory = getRegistryValue ("Library", "sub_directory", "computers");
-
- /////////////////////////////////////
- function GetSubDirectories (directory)
- {
- var buffer = "<select name='sub_directory' onChange='window.reparse()'>";
- dir_path = getProgramDirectory() + "/library/" + directory + "/";
- dir_array = getDirectoryList (dir_path + "*.");
- dir_array.sortStrings();
- for (n=0; n< dir_array.count; n++){
- file_path = dir_path + dir_array[n] + "/";
- file_array = getFileList (file_path + "*.*");
- file_array.sortStrings();
- buffer += "<option value='" + dir_array[n] + "'>";
- buffer += dir_array[n];}
- return buffer;
- }
- ////////////////////
- function GetImages ()
- {
- if (sub_directory == "") return "";
-
- var buffer = "";
- dir_path = getProgramDirectory() + "/library/images/";
- file_path = dir_path + sub_directory + "/";
- file_array = getFileList (file_path + "*.*");
- file_array.sortStrings();
- for (m=0; m< file_array.count; m++){
- file_name = file_path + file_array[m];
- buffer += "<img toolbutton src='" + file_name + "' ";
- buffer += "onMouseUp=\"AddLibraryFile('" + file_name + "')\" title='" + file_array[m] + "'>";
- buffer += "<spacer width=15>";}
- return buffer;
- }
- ////////////////////
- function GetSounds ()
- {
- var buffer = "";
- file_path = getProgramDirectory() + "/library/sounds/";
- file_array = getFileList (file_path + "*.*");
- file_array.sortStrings();
- for (m=0; m< file_array.count; m++){
- file_name = file_path + file_array[m];
- buffer += "<img button src='images/small_sound.bitmap' onMouseUp=\"AddLibraryFile('" + file_name + "')\" title='Add sound'>";
- buffer += "<spacer width=8>";
- buffer += file_array[m];
- buffer += "<br>";}
- return buffer;
- }
- /////////////////////////////////
- function AddLibraryFile (filename)
- {
- setRegistryValue ("Library", "directory", directory);
- setRegistryValue ("Library", "sub_directory", sub_directory);
- new_object = fileLoad (filename);
- window.returnValue (new_object);
- window.close ();
- }
- ////////////////
- function Close ()
- {
- setRegistryValue ("Library", "directory", directory);
- setRegistryValue ("Library", "sub_directory", sub_directory);
- window.close ();
- }
-
- </script>
-
- <body bgcolor="#FFFFFF" text="#000000" width=-100 height=400 background="backgrounds\whitegrain.gif" translate>
- <div valign=middle>
-
- <img src='images/small_bullet_blue.bitmap'>Choose a category<spacer>
-
- <select name="directory" onChange='window.reparse()'>
- <option value="images">images
- <option value="sounds">sounds
- </select>
-
- <if value="directory=='images'">
- <include value="GetSubDirectories('images')">
- <p><img src='images/small_bullet_blue.bitmap'>Then click on the image that you want to add to your movie
- <p><include value="GetImages()">
- </if>
-
- <if value="directory=='textures'">
- <include value="GetSubDirectories('textures')">
- <p><img src='images/small_bullet_blue.bitmap'>Then click on the image that you want to add to your movie
- <p><include value="GetImages()">
- </if>
-
- <if value="directory=='sounds'">
- <p><ul><ul><include value="GetSounds()"></ul></ul>
- </if>
- <p>
-
- <table cellspacing=0 cellpadding=0 width="100%">
- <tr><td align=right>
- <a button onMouseUp="Close()" width=+20 height=+2><img src="images/small_cancel.bitmap" hspace=4>Cancel</a>
- </table>
-
- <spacer height=4>
-